package com.litong.litongjiaoyu.service.impl;

import com.litong.litongjiaoyu.dao.StudentDao;
import com.litong.litongjiaoyu.entity.StudentUserinfo;
import com.litong.litongjiaoyu.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName StudentServiceImpl
 * @Description TODO
 * @Author jingz
 * @Date 2019/11/5 18:34
 * @Version 1.0
 **/

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Transactional
    @Override
    public int insert(StudentUserinfo studentUserinfo) {
        return studentDao.insert(studentUserinfo);
    }

    @Transactional
    @Override
    public int batchRemove(int[] id) {
        return studentDao.batchRemove(id);
    }

    @Transactional
    @Override
    public int remove(int id) {
        return studentDao.remove(id);
    }

    @Transactional
    @Override
    public int update(StudentUserinfo studentUserinfo) {
        return studentDao.update(studentUserinfo);
    }

    @Override
    public List<StudentUserinfo> query() {
        return studentDao.query();
    }

    @Override
    public StudentUserinfo selectById(int id) {
        return studentDao.selectById(id);
    }

    @Override
    public StudentUserinfo selectAll(String openid) {
        return studentDao.selectAll(openid);
    }

    @Override
    public String selectByPhone(String phone) {
        return studentDao.selectByPhone(phone);
    }
}
